home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_06
/
1006075a
< prev
next >
Wrap
Text File
|
1992-04-22
|
991b
|
42 lines
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#define CMD_LEN 133
#define DEP_LEN 40
typedef enum {WHITE, GRAY, BLACK} COLOR;
#define FAIL 1
#define SUCCEED 0
typedef struct CMD {
struct CMD *link;
char cmdstr[ CMD_LEN ];
} CMD;
typedef struct DEP {
struct DEP *link;
char depstr[ DEP_LEN ];
} DEP;
typedef struct TARGET {
struct TARGET *link;
char target[ DEP_LEN ];
struct CMD *cmdlink;
struct DEP *deplink;
enum COLOR color;
} TARGET;
TARGET *parse_makefile(int argc, char *argv[], char *target);
long process_dep(TARGET *p, char *starting_dep);
TARGET *add_target(TARGET **head, char *target);
DEP *insert_dependency(TARGET *p, char *dependency);
CMD *insert_cmd(TARGET *p, char *cmd);
char *skip_ws(char *s);
TARGET *search_target_list(TARGET *head, char *target);
long build_target(TARGET *head, TARGET *p, time_t *parent_t);
long exec_cmd_list(CMD *p);
long fatal_error(char *s);